package aceona.api.weibo.sina;

import java.io.IOException;
import java.util.Properties;

public class SinaScannerConsts {
	
	private static String currentConfigFileName = "sina.properties";
	
	private static Properties props = new Properties();
	
	static {
		load(currentConfigFileName);
	}
	public static String getProperty(String key){
		return props.getProperty(key);
	}
	
	public static void load(String filename){
		try {
			if(filename != null && !"".equals(filename)){
				currentConfigFileName = filename;
			}
			props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(currentConfigFileName));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static void flush(){
		try {
			props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(currentConfigFileName));
		} catch (IOException e) {
			e.printStackTrace();
		}		
	}
}
